package be.novelfaces.showcase.webdriver.util;

import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;


public class AjaxHelper {

	public void waitForAjaxToComplete(WebDriver driver) {
		new Waiter(driver) {
			@Override
			public Boolean waitForCondition(WebDriver driver) {
				return  (Boolean) ((JavascriptExecutor)driver).executeScript("return !ajaxBusy");
			}
		};
	}

}
